How To Add Linkedin Share Button To Website

How To Add LinkedIn Share Button To Website Below Each Post

For a website, it’s important to have the social sharing buttons below each post so that your readers can spread the love. Do you know how to add LinkedIn share button to website?

Most of the users add the sharing buttons using the plugins. It’s because, for a non-techie person, it would be quite hard to understand the concept of coding.

In this tutorial, I am going to tell you how to add LinkedIn share button to website without using any plugin. You just have to use the LinkedIn script and the WordPress function.

Use The LinkedIn Code Generator To Add The Share Button.

If you don’t know, let me tell you that LinkedIn has many buttons to add to your website. And here you need the share button.

So with the LinkedIn generator, you can generate the code and it would be similar to the code shown below.

In the above code, the main URL of the domain would be shared. But you need to add LinkedIn share button to website below each post.

NOTE: To make it work on every post, you have to replace the URL of your website with the WordPress function.

data-url=”<?php the_permalink(); ?>”

For Vertical Count.

<script src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>

<script type=”IN/Share” data-url=”<?php the_permalink(); ?>” data-counter=”top”></script>

For Horizontal Count.

<script src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>

<script type=”IN/Share” data-url=”<?php the_permalink(); ?>” data-counter=”right”></script>

For No Count.

<script src=”//platform.linkedin.com/in.js” type=”text/javascript”> lang: en_US</script>

<script type=”IN/Share” data-url=”<?php the_permalink(); ?>”></script>

In all the three codes, you have to add the permalink function of WordPress. It would pick up the permalink of each post of your website to get shared on LinkedIn.

And the position of the number of shares can be adjusted as shown above. The “data-counter” option is handling it. If you don’t want to show the counts then remove it from the code as shown in the final code.

Do You Now Know How To Add LinkedIn Share Button To Website

There is always a taboo about using the codes. People get afraid. The only thing you need to understand is the concept.

And adding the LinkedIn share button is so easy. Just edit the script provided by the LinkedIn generator. You can do a lot of things with this code.

If you want to add the follow button to your website then just copy and paste the code from LinkedIn. You won’t need to edit it.

You have successfully added the share button. If you have any doubt, feel free to clear it.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.


Get Free Updates Into Your Inbox

Learn Everything Just Like I Did

SUBSCRIBE



10 comments

  1. Hi there Ravi,

    Actually I haven’t use linkedin from the begginning but lately when I saw it’s powers I just jumped to it. It’s your resume for the work that you wanna get (that stands the word linkedin for me).

    Actually is a good idea adding linkedin to the blog, since many bloggers already use it.

    Cheers,

    Clay.

    1. Hey Clay,

      LinkedIn is the biggest professional network and you can reach to many people. The sharing button to our website can help you to get more traffic.

      People like to spread the love.

      Thanks for stopping by.

      Enjoy your day.

      ~Ravi

  2. LinkedIn was always remain strong when it comes to business networking. You build your network, work together, share your work, get job, offer job, we can do many more things on this network. This networking platform is widely used by people all over the world, adding LinkedIn sharing button to you website or blog definitely prove beneficial, as people can share their favorite story or article with his network.

    1. Hey Ryan,

      No doubt that LinkedIn has helped many people to get a job. From your blog, you can get many followers. the sharing button can help you to leverage your blog post.

      Thanks for commenting.

      ~Ravi

    1. Hey Carolyn,

      Most of the WordPress users go with the plugins. But if you can do it with the code then what’s the need to increase one more plugin.

      Thanks for commenting.

      ~Ravi

  3. Hey Ravi,

    Thanks for the quick and handy code.

    Btw, do you have any suggestions for a light-weight social share plugin which doesn’t affect loading speed?

    Much like Woorkup.com where Brian uses custom code for those awesome looking social share buttons.

    Thanks!

    1. Hi Shafi,

      Social Warfare is one of the lightweight plugins I have come across. I have tried more than 17 social sharing plugins. I bought the premium plugins like Monarch and a few others.

      But I think Social Warfare is better. The rest people have their own perspectives.

      Thanks for stopping by.

      ~Ravi

Leave a Reply

Your email address will not be published. Required fields are marked *